/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package controller;

import dao.LogradouroDAO;
import java.sql.SQLException;
import java.util.List;
import model.LogradouroModel;

/**
 *
 * @author WELISSON
 */
public class LogradouroController {
    
    public LogradouroModel getLogradouro(String cep) throws SQLException{
        List<LogradouroModel> logradouro = new LogradouroDAO().findByArgument("cep", cep);
        LogradouroModel logra;
        
        if(!logradouro.isEmpty()){
            logra = logradouro.get(0);
        }else{
            logra = null;
        }
        return logra;

    }
    
    
    
}
